//课程所有接口
import request from '../utils/request'
// 课程封面上传接口
export function upImgApi(data) {
    return request("/VueHandler/UpLoadPicHandler", "post", data, "mul")
}
//课程基本信息添加接口
export function addCourse(data) {
    return request("/VueHandler/CourseHandler?action=add", "post", data)
}
// 课程列表接口
export function getCourseList(data) {
    return request("/VueHandler/CourseHandler?action=show", "post", data)
}
// 课程上架下架
export function upAndDown(ID) {
    return request("/VueHandler/CourseHandler?action=state", "post", { ID: ID })
}
//删除课程接口
export function delCourse(_id) {
    return request("/VueHandler/CourseHandler?action=delete", "post", { _id: _id })
}
// 通过id请求课程信息
export function getCourseById(ID) {
    return request("/VueHandler/CourseHandler?action=getcourse", "get", { ID: ID })
}
// 添加目录接口
export function addDir(data) {
    return request("/VueHandler/CourseHandler?action=AddDirectory", "post", data)
}
// 对应的目录下添加视频
export function addDirVideo(data) {
    return request("/VueHandler/CourseHandler?action=addvideo", "get", data)
}
// 获取目录下的视频列表
export function getDirVideo(data) {
    return request("/VueHandler/VideoHandler?action=showdir", "get", data)
}
// 删除目录接口
export function delDir(data) {
    return request("/VueHandler/CourseHandler?action=deleteDirectory", "get", data)
}
// 获取课程下的目录列表
export function getCourseDir(data) {
    return request("/VueHandler/VideoHandler?action=finddir", "get", data)
}
// 编辑目录接口
export function editDirApi(data) {
    return request("/VueHandler/CourseHandler?action=updateDirectory", "post", data)
}
// 删除目录下的视频
export function delDirVideo(data) {
    return request("/VueHandler/CourseHandler?action=delvideo", "get", data)
}
// 整个课程的添加和编辑
export function saveAllCourse(data) {
    return request("/VueHandler/CourseHandler?action=update", "post", data)
}
//课程 置顶
export function topCourse(ID) {
    return request("/VueHandler/CourseHandler?action=top", "post", { ID: ID })
}